package com.ysyc.driver_ee.adapter;

import android.app.Activity;
import android.view.View;
import android.widget.TextView;

import com.ysyc.driver_ee.R;
import com.ysyc.driver_ee.base.BaseAdapter;
import com.ysyc.driver_ee.model.OrderForm;
import com.ysyc.driver_ee.tools.DateUtils;
import com.ysyc.driver_ee.tools.StatusSettingUtils;

/**
 * <p>描述：(这里用一句话描述这个类的作用)</p>
 * 作者： Chan<br>
 * 日期： 2018/11/7 16:26<br>
 * 版本： v1.0<br>
 */
public class DriverDetailsAdapter extends BaseAdapter<OrderForm> {

    public DriverDetailsAdapter(Activity activity, int layoutView) {
        super(activity, layoutView);
    }

    @Override
    public void convert(MyViewHolder holder, OrderForm item) {
        View itemView = holder.itemView;
        TextView timeServiceTv = itemView.findViewById(R.id.tv_time_service_view);
        TextView statusTv =itemView.findViewById(R.id.tv_status_view);
        TextView startingPointTv =itemView.findViewById(R.id.tv_starting_point_view);
        TextView endPointTv =itemView.findViewById(R.id.tv_end_point_view);
        startingPointTv.setText(item.startName);
        endPointTv.setText(item.endName);
        StatusSettingUtils.setOrderFromStatus(statusTv,item.status);
        timeServiceTv.setText(DateUtils.orderTime(item.startArriveTime));


    }
}
